#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<assert.h>
int my_strncmp(const char* str1,const char* str2,size_t num)
{
    assert(str1 != NULL);
	assert(str2 != NULL);
	while(num--)
	{
	    if(*str1 == *str2)
		{
		    str1++;
			str2++;
		}
		else
		{
		    if(*str1 > *str2)
			{
			    return 1;
			}
			else
			{
			    return -1;
			}
		}
	}
	return 0;
}
int main()
{
	char arr1[] = "abcdef";
	char arr2[] = "abcde";
	printf("%d\n",my_strncmp(arr1,arr2,6));
	return 0;
}